 package com.gmrz.uaf.protocol.v1.json;
 
 import com.google.gson.InstanceCreator;
 import com.google.gson.JsonDeserializationContext;
 import com.google.gson.JsonDeserializer;
 import com.google.gson.JsonElement;
 import com.google.gson.JsonParseException;
 import com.google.gson.JsonSerializationContext;
 import com.google.gson.JsonSerializer;
 import com.gmrz.uaf.protocol.v1.schema.SupportedScheme;

 import java.lang.reflect.Type;
 
 public class SupportedSchemeAdapter
   implements InstanceCreator<SupportedScheme>, JsonSerializer<SupportedScheme>, JsonDeserializer<SupportedScheme>
 {
   public SupportedScheme createInstance(Type type)
   {
     return new SupportedScheme();
   }
 
   public JsonElement serialize(SupportedScheme src, Type typeofSrc, JsonSerializationContext context)
   {
     return context.serialize(src.getScheme().getName());
   }
 
   public SupportedScheme deserialize(JsonElement json, Type typeofT, JsonDeserializationContext context)
     throws JsonParseException
   {
     return new SupportedScheme().withScheme(SupportedScheme.Scheme.fromValue(json.getAsString()));
   }
 }
